<?php
$oID = $_GET['oID'];
remove_order($oID, $_POST['restock']);

if($_POST['paypaldelete']){
	$values = $db->db_query("SELECT * FROM " . TABLE_PAYPAL . " WHERE order_id = '" . $oID . "'");

	while (!$values->EOF) {
		$db->db_query("DELETE FROM " . TABLE_PAYPAL_STATUS_HISTORY . " WHERE paypal_ipn_id = '" . $values->fields['paypal_ipn_id'] . "'");
	$values->MoveNext();
	}
$db->db_query("DELETE FROM " . TABLE_PAYPAL . " WHERE order_id = '" . $oID . "'");
}
?>